<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"> </meta>
    <title>Title</title>
</head>
<body>
<!--直接加入thymeleaf标签即可-->
<h1>遍历</h1>
<table border="1">
    <tr>
        <th>id</th>
        <th>age</th>
        <th>name</th>
    </tr>
    <tr th:each="user: ${list}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.age}"></td>
        <td th:text="${user.name}"></td>

    </tr>
</table>
<div th:switch="${grade}">
    <span th:case="1">it's 1</span>
    <span th:case="2">it's 2</span>
    <span th:case="3">it's 3</span>
</div>

</body>
</html>